package main

import (
	"math"
	"fmt"
)

type point struct {
	x float64
	y float64
	z float64
}

func (p point) printInfo()  {

}
func getDistance(x1,x2,y1,y2,z1,z2 float64) float64 {
	dis:=math.Sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))
	return dis
}
func getDistance2(p1,p2 point) float64{
	dis:=math.Sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)+(p1.z-p2.z)*(p1.z-p2.z))
	return dis
}
func (p point) getDistance3(p2 point)float64{
	dis:=math.Sqrt((p.x-p2.x)*(p.x-p2.x)+(p.y-p2.y)*(p.y-p2.y)+(p.z-p2.z)*(p.z-p2.z))
	return dis
}

func main()  {
	p1:=point{0,0,0}
	p2:=point{2.4,4.1,6.3}

	res1:=getDistance(p1.x,p2.x,p1.y,p2.y,p1.z,p2.z)
	fmt.Println(res1)

	res2:=getDistance2(p1,p2)
	fmt.Println(res2)

	p3 := point{1.4,6.8,3.7}
	res3:=p1.getDistance3(p2)
	fmt.Println(res3)
	res4:=p1.getDistance3(p3)
	res5:=p3.getDistance3(p2)
	res6:=p2.getDistance3(p3)

	fmt.Println(res4)
	fmt.Println(res5)
	fmt.Println(res6)
}
